﻿/*****************************************************************//**
 *
 * @file   FITKAbaqusAdaptorInteractionSurfToSurf.h
 * @brief  Abaqus Interaction 适配器 用于读取INP过程中的Interaction解析。
 * @author fulipeng (flipengqd@yeah.net)
 * @date   2024-04-23
 *
 *********************************************************************/
#ifndef __FITKABAQUSADAPTORINTERACTIONSURFTOSURF__H__
#define __FITKABAQUSADAPTORINTERACTIONSURFTOSURF__H__

#include "FITKAbaqusAbstractAdaptor.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"

 //前置声明
ForwardDeclarNS(AbaqusData, FITKDataCase)
ForwardDeclarNS(Interface, FITKAbaAssembly)
ForwardDeclarNS(Interface, FITKComponentManager)
ForwardDeclarNS(Interface, FITKAbaAbstractInteraction)
ForwardDeclarNS(Interface, FITKAbaInteractionSurfToSurfExplicit)
ForwardDeclarNS(Interface, FITKAbaInteractionGeneralContactExplicit)

namespace IO
{
    /**
     * @brief Abaqus 接触 读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-04-23
     */
    class FITKAbaqusAdaptorInteractionSurfToSurf : public FITKAbaqusAbstractAdaptor
    {
    public:
        explicit FITKAbaqusAdaptorInteractionSurfToSurf() = default;
        ~FITKAbaqusAdaptorInteractionSurfToSurf() = default;


        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        QString getAdaptorClass() override;

        /**
         * @brief 设置算例数据对象
         * @param caseData
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        void setCaseData(AbaqusData::FITKDataCase* caseData);

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool adaptW() override;

    private:

        /**
         * @brief 读取接触
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool readContact();

        /**
         * @brief 读取表面与表面接触
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool readContactPair();

        /**
         * @brief 读取接触
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool readContactInclusions();

        /**
         * @brief 读取接触任务属性
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool readContactPropertyAssignment();


        /**
         * @brief 写出接触
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool writeContact();

        /**
         * @brief 写出接触清除
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool writeContactClearance();

        /**
         * @brief 写出接触
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool writeContactInclusions();

        /**
         * @brief 写出接触任务属性
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool writeContactPropertyAssignment();
    private:

        /**
         * @brief 算例数据
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-13
         */
        AbaqusData::FITKDataCase* _caseData{};

        /**
         * @brief 接触数据
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        Interface::FITKAbaAbstractInteraction* _iteractionData{};

        /**
         * @brief 所有part下的 集合管理器
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        QList<Interface::FITKComponentManager*> _setManagerList{};

        /**
         * @brief 是否显式分析
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-23
         */
        bool isExplicit = false;
    };

    Register2FITKIOAdaptorFactory(INP, Interface::FITKAbaInteractionSurfToSurfExplicit, FITKAbaqusAdaptorInteractionSurfToSurf, 1);
    Register2FITKIOAdaptorFactory(INP, Interface::FITKAbaInteractionGeneralContactExplicit, FITKAbaqusAdaptorInteractionSurfToSurf, 2);

}

#endif